The present invention relates to a device and method for extracting a MPEG video elementary stream. Particularly, the present invention relates to a circuit that extracts an ES (Elementary Stream) from a PS (Program Stream) and extracts an ES (Elementary Stream) from TS (Transport Program).
MPEG (Moving Picture Experts Group) system stream includes streams of two types: a PS (program stream) of the scheme of multiplexing one program (movie and program) to basic packets and transmitting in a time division mode and a TS (transport stream) of the multiplexing/separating scheme compatible with multi-programs.
The system, such as an electronic watermark inserter/detector, handling image information compressed as a MPEG stream requires to extract V-ES (Video-Elementary Stream) being data including TS/PS.
There is the so-called DEMUX as a circuit of extracting ES from PS or TS. The DEMUX circuit includes the PS input circuit and the TS input circuit, separately, or the PS processor and the TS processor, separately. These circuits are selectively used.
In the system, for example, inputting TS and outputting V-ES, the conventional DEMUX circuit outputs only the V-ES but discards all or part of other data sets.
In the conventional circuit that extracts ES from PS or TS, when the PS input circuit and the TS input circuit are selectively used, it is required to previously supply information about TS or PS to the switching circuit.
Moreover, in the data internally discarding process, the TS stream is reformed to the original TS stream by combining V-ES with other data.
The present invention is made to solve the above-mentioned problems.
An object of the present invention is to provide a MPEG video elementary stream extractor that once extracts a video stream and then changes part of the video stream data, whereby the changed data can be easily returned into the original stream structure. Another object of the present invention is to provide a MPEG video elementary stream extraction method used for the above-mentioned extractor.
In a MPEG (Moving Picture Experts Group) video elementary stream extractor according to the present invention, an elementary stream, or data, is extracted from a program stream or a transport stream. The program stream complies with the scheme of multiplexing one program into basic packets and then transmitting the basic packets in a time division mode. The transport stream complies with a multiplex/separation scheme compatible with a multi-program. The extractor comprises a decider for deciding that an input stream is the program stream or the transport stream, and means for allowing the elementary stream to be extracted based on a decision result of the decider.
In a MPEG (Moving Picture Experts Group) video elementary stream extracting method according to the present invention, an elementary stream, or data, is extracted from a program stream or a transport stream. The program stream complies with the scheme of multiplexing one program into basic packets and then transmitting the basic packets in a time division mode. The transport stream complies with a multiplex/separation scheme compatible with a multi-program. The method comprises the steps of deciding that a stream is the program stream or the transport stream; and allowing the elementary stream to be extracted based on a decision result.
That is, the MPEG video element stream extractor, according to the present invention, automatically determines TS or PS to be input and can correctly extract ES.
In a TS, a stream such as PAT (Program Association Table) or CAT (Conditional Access Table) is transmitted in addition to a V-ES. Hence, generally, in order to certainly extract a V-ES contained in a TS, the extraction circuit externally specifies and extracts a PID (Packet Identification) containing a V-ES. In contrast, according to the present invention, a PID containing a V-ES is detected and extracted automatically. The system that separately supplies position information of a leading synchronous byte of the TS stream is generally used. According to the present invention, the synchronous byte detector solves such a problem.
The electronic watermark inserter varies part of a MPEG stream to print information and then outputs the stream in conformity with the original TS or PS stream specification. However, the method of discarding data other than V-ES, such as the conventional DEMUX process, cannot extract the stream.
According to the present invention, an input stream is output as an output stream without any change while one-bit signal is added to the output stream. The level of the one-bit signal represents that data in a current output mode is a V-ES or a stream other than the V-ES. A clock synchronous circuit implements the above-mentioned operation. The clock synchronous circuit always produces data with a delay for three clocks while implementing the above-mentioned operation.
The clock synchronous circuit automatically determines the type of TS or PS. The clock synchronous circuit outputs the signal representing a portion of a V-ES while the whole of the stream is being output. The present invention has the configuration that outputs the input stream without any change. Hence, the system can be easily realized that once extracts the video stream, changes part of video stream data, and thus recovers it to the original stream structure.